<?php 
	//$baseUrl = $this->baseUrl().'/admin';
	//$this->headScript()->prependFile($baseUrl.'/jqueryui/ui/jquery.ui.tabs.js')
?>
		<div class="breadcrumb clearfix">
			<div class="title k1">Cập nhật Tour</div>
		</div>
		<ul id="warning-box" class="error-box" style="display: none;">
			<li class="first">Bạn vui lòng kiểm tra lại thông tin bên dưới</li>
		</ul>
		<form enctype="multipart/form-data" action="<?php echo $this->baseUrl().'/admin/tour/edit/tour_id/'.$this->tour['tour_id']; ?>" method="post" id="form_edit">
			<div class="clearfix">
				<table width="100%" cellpadding="0" cellspacing="0" border="0" class="table_input_wapper">
					<tr>
						<td colspan="2">
							<h2><span>1</span>Thông tin cơ bản</h2>
						</td>
					</tr>
					<tr class="table_input_tr">
						<td width="50%" class="table_input_td">
							<div class="table_input_title">
								<label>Tên Tour:</label>
							</div>
							<input name="tour_name" id="tour_name" value="<?php echo $this->escape($this->tour['tour_name']);?>" class="table_input_text"/>
						</td>
						<td width="50%" class="table_row table_input_td_last">
							<div class="table_input_title">
								<label>Danh mục:</label>
							</div>
							<div class="clear"></div>
							<?php echo $this->checkBoxList($this->categories, array('category_id', 'category_name'), 'category_id[]', 'category_id', $this->categoriesSelected);?>					
						</td>
					</tr>
					<tr>
						<td width="50%" class="table_input_td table_input_td_end">
							<div class="table_input_title">
								<label>Ảnh đại diện:</label>
							</div>
							<input type="file" name="tour_image" id="tour_image" class="table_input_text"/>
						</td>
						<td width="50%" class="table_row table_input_td_last table_input_td_end">
							<div class="table_input_title">
								<label>Mã tour:</label>
							</div>
							<input name="tour_no" id="tour_no" value="<?php echo $this->escape($this->tour['tour_no']);?>" class="table_input_text"/>
						</td>
					</tr>
					<tr class="table_input_tr">
						<td width="50%" class="table_input_td table_input_td_end">
							<div class="table_input_title">
								<label>Giá tham khảo:</label>
							</div>
							<input name="tour_price" id="tour_price" value="<?php echo $this->escape($this->tour['tour_price']);?>" class="table_input_text"/>
						</td>
						<td width="50%" class="table_row table_input_td_last table_input_td_end">
							<div class="table_input_title">
								<label>Thời gian:</label>
							</div>
							<input name="tour_duration" id="tour_duration" value="<?php echo $this->escape($this->tour['tour_duration']);?>" class="table_input_text"/>
						</td>
					</tr>
					<tr>
						<td width="50%" class="table_input_td table_input_td_end">
							<div class="table_input_title">
								<label>Khởi hành từ:</label>
							</div>
							<?php echo $this->dropList($this->locations, array('location_id', 'location_name'), 'tour_departure', 'tour_departure', 'table_input_text', $this->tour['tour_departure'], 'Chọn nơi khởi hành');?>
						</td>
						<td width="50%" class="table_row table_input_td_last table_input_td_end">
							<div class="table_input_title">
								<label>Người liên hệ:</label>
							</div>
							<input name="tour_contact" id="tour_contact" value="<?php echo $this->escape($this->tour['tour_contact']);?>" class="table_input_text"/>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<h2><span>2</span>Nội dung chính</h2>
						</td>
					</tr>
					<tr class="table_input_tr">
						<td width="100%" colspan="2" class="table_input_td">
							<div class="table_input_title">
								<label>Trích dẫn:</label>
							</div>
							<textarea name="tour_intro" id="tour_intro"><?php echo $this->tour['tour_intro'];?></textarea>
						</td>
					</tr>
					<tr>
						<td width="100%" colspan="2" class="table_input_td table_input_td_end">
							<div class="table_input_title">
								<label>Toàn bài:</label>
							</div>
							<textarea name="tour_details" id="tour_details"><?php echo $this->tour['tour_details'];?></textarea>
						</td>
					</tr>
					<tr>
						<td width="100%" colspan="2" class="table_input_td table_input_td_end">
							<div class="table_input_title">
								<label>Giá chi tiết:</label>
							</div>
							<textarea name="tour_price_details" id="tour_price_details"><?php echo $this->tour['tour_price_details'];?></textarea>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<h2><span>3</span>SEO</h2>
						</td>
					</tr>
					<tr class="table_input_tr">
						<td width="50%" class="table_input_td">
							<div class="table_input_title">
								<label>Tiêu đề:</label>
							</div>
							<input name="tour_title" id="tour_title" class="table_input_text" value="<?php echo $this->escape($this->tour['tour_title']);?>"/>
						</td>
						<td width="50%" class="table_row table_input_td_last">
							<div class="table_input_title">
								<label>Từ khóa:</label>
							</div>
							<input name="meta_keywords" id="meta_keywords" class="table_input_text" value="<?php echo $this->escape($this->tour['meta_keywords']);?>"/>
						</td>
					</tr>
					<tr>
						<td width="50%" class="table_input_td">
							<div class="table_input_title">
								<label>Mô tả:</label>
							</div>
							<textarea name="meta_description" id="meta_description" rows="3" class="table_input_text"><?php echo $this->tour['meta_description'];?></textarea>
						</td>
						<td width="50%" class="table_row table_input_td_last">
						</td>
					</tr>
				</table>
				<div class="table_input_end button_listing_input clear">
					<input type="button" name="Cập nhật" value="" class="button_update" id="buttom_submit">
					<input type="button" name="Cập nhật" value="" class="button_cancel">
				</div>
			</div>
		</form>
		
		
<div id="tabs"> 
	<ul> 
		<li><a href="#tabs-1">Thông tin chính</a></li>
		<li><a href="#tabs-2">Thông tin chi tiết</a></li> 
		<li><a href="#tabs-3">Chi tiết giá</a></li> 
		<li><a href="#tabs-4">Danh mục & Tag</a></li>
		<li><a href="#tabs-5">SEO</a></li> 
	</ul> 
	<div id="tabs-1"> 
		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="table_input_wapper">
			<tr>
				<td colspan="2">
					<h2><span>1</span>Thông tin cơ bản</h2>
				</td>
			</tr>
			<tr class="table_input_tr">
				<td width="50%" class="table_input_td">
					<div class="table_input_title">
						<label>Tên Tour:</label>
					</div>
					<input name="tour_name" id="tour_name" value="<?php echo $this->escape($this->tour['tour_name']);?>" class="table_input_text"/>
				</td>
				<td width="50%" class="table_row table_input_td_last">
					<div class="table_input_title">
						<label>Danh mục:</label>
					</div>
					<div class="clear"></div>
					<?php echo $this->checkBoxList($this->categories, array('category_id', 'category_name'), 'category_id[]', 'category_id', $this->categoriesSelected);?>					
				</td>
			</tr>
		</table> 
	</div> 
	<div id="tabs-2"> 
		<p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p> 
	</div> 
	<div id="tabs-3"> 
		<p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p> 
		<p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p> 
	</div> 
	<div id="tabs-4"> 
		<p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p> 
		<p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p> 
	</div>
	<div id="tabs-5"> 
		<p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p> 
		<p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p> 
	</div>
</div>
<script type="text/javascript">
	$().ready(function() {
		$( "#tabs" ).tabs();
		var tinymce_path = '<?php echo $this->baseUrl()?>/admin/js/tiny_mce/tiny_mce.js'; 
		$('#tour_intro').tinymce({
			// Location of TinyMCE script
			script_url : tinymce_path,
	
			// General options
			theme : "simple",
			language 	: "vi",
            theme 		: "advanced",
            plugins 	: "paste",
            width		: "805",
            height		: "100",
			plugins 	: "paste",
	
			// Theme options
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,|,table,removeformat,code",
			theme_advanced_buttons2 : "",
	        theme_advanced_buttons3 : "",
	        theme_advanced_buttons4 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,
	
			// Example content CSS (should be your site CSS)
			content_css : "css/content.css",
	
			// Drop lists for link/image/media/template dialogs
			//template_external_list_url : "lists/template_list.js",
			//external_link_list_url : "lists/link_list.js",
			//external_image_list_url : "lists/image_list.js",
			//media_external_list_url : "lists/media_list.js"
		});
		$('#tour_details').tinymce({
			// Location of TinyMCE script
			script_url : tinymce_path,
	
			// General options
			theme : "advanced",
			language 	: "vi",
            theme 		: "advanced",
            plugins 	: "paste",
            width		: "805",
            height		: "300",
			plugins 	: "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
	
			// Theme options
			theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,
	
			// Example content CSS (should be your site CSS)
			content_css : "css/content.css",
	
			// Drop lists for link/image/media/template dialogs
			template_external_list_url : "lists/template_list.js",
			external_link_list_url : "lists/link_list.js",
			external_image_list_url : "lists/image_list.js",
			media_external_list_url : "lists/media_list.js"
		});

		$('#tour_price_details').tinymce({
			// Location of TinyMCE script
			script_url : tinymce_path,
	
			// General options
			theme : "advanced",
			language 	: "vi",
            theme 		: "advanced",
            plugins 	: "paste",
            width		: "805",
            height		: "300",
			plugins 	: "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
	
			// Theme options
			theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,
	
			// Example content CSS (should be your site CSS)
			content_css : "css/content.css",
	
			// Drop lists for link/image/media/template dialogs
			template_external_list_url : "lists/template_list.js",
			external_link_list_url : "lists/link_list.js",
			external_image_list_url : "lists/image_list.js",
			media_external_list_url : "lists/media_list.js"
		});
		
		$("#buttom_submit").click(function(){
            $("#form_edit").submit();
        });
		$("#form_edit").validate({
            rules: {
				tour_name: {
                    required: true,
                    maxlength: 255
                }
            },
	        messages: {
    	        tour_name: "",
	        },
		    errorLabelContainer: "#warning-box",
		    wrapper: "li",
		    submitHandler: function(form) {
		        form.submit();
		    }
		});
	});
</script>